home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / ptv1n2.arc / 256COLOR.BAS next >
BASIC Source File  |  1990-06-14  |  881b  |  48 lines

  1. ' 256COLOR.BAS -- M. Covington 1990
  2.  
  3. DEFINT A-Z
  4. DIM P(0 TO 256) AS LONG  ' the palette
  5.  
  6. ' Set video mode
  7.  
  8. SCREEN 13
  9. PRINT "      Remapping colors..."
  10.  
  11. ' Redefine colors 1-253
  12.  
  13. DIM L(3)
  14. L(1) = 0        ' initial red, green, and blue levels
  15. L(2) = 0
  16. L(3) = 42
  17.  
  18. C = 1           ' which color is being defined (1-252)
  19. W = 2           ' which element of V is changing
  20. I = 1           ' what's being added to L(I)
  21.  
  22. FOR S = 1 TO 6          ' 6 sectors of color wheel
  23.   FOR N = 1 TO 42       ' 42 colors in each
  24.     P(C) = L(1) + 256 * L(2) + 65536 * L(3)
  25.     C = C + 1
  26.     L(W) = L(W) + I
  27.   NEXT
  28.   W = (W MOD 3) + 1
  29.   I = -I
  30. NEXT
  31.  
  32. ' Define the remaining colors
  33.  
  34. P(0) = 0
  35. P(254) = P(253) + 5
  36. P(255) = P(254) + 5
  37.  
  38. ' Set the palette
  39.  
  40. PALETTE USING P(0)
  41.  
  42. ' Demonstrate the results
  43.  
  44. FOR C = 0 TO 255
  45.   LINE (C + 32, 0)-(C + 32, 180), C
  46. NEXT
  47.  
  48. END